package com.kkd.kkdapp.view;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.view.View;

public class RoundView extends View {

	private Paint mPaint;
	private int mColor = Color.parseColor("#29ff97");

	public RoundView(Context context) {
		super(context);
		mPaint = new Paint();
	}

	public RoundView(Context context, AttributeSet attrs) {
		super(context, attrs);
		mPaint = new Paint();
	}

	@Override
	protected void onDraw(Canvas canvas) {
		super.onDraw(canvas);
		mPaint.setAntiAlias(true);
		mPaint.setFilterBitmap(true);
		mPaint.setDither(true);
		mPaint.setColor(mColor);
		canvas.drawCircle(getWidth() / 2, getHeight() / 2, getWidth() / 2,
				mPaint);
	}

	public void setColor(int color) {
		mColor = color;
		invalidate();
	}
}
